<?php include('header.php'); ?>

<div class="row">


				<div class="span6">
					<div class="row">

						<div class="product-details clearfix">
							<div class="span6">
								
								<div class="product-img">
								<?php
									$photo	= theme_img('no_picture.png', lang('no_image_available'));
									if($product->primary_photo)
										$photo	= '<img src="'.base_url('images/'.$product->primary_photo).'" alt="'.$product->seo_title.'"/>';
									?>
									<a class="fancybox" href="<?php echo base_url('images/'.$product->primary_photo)?>"><?php echo $photo?></a>
								</div><!--end product-img-->
								<?php 
								if(count($product->images) > 1):?>
								<div class="product-img-thumb">
										<?php foreach($product->images as $image):?>
											<a class="fancybox" href="<?php echo base_url('images/thumbnails/'.$image);?>"><img src="<?php echo base_url('images/thumbnails/'.$image);?>" alt="<?php echo $product->seo_title?>"></a>
										<?php endforeach;?>
								</div>
								<?php endif;?>
								<!--end flexslider-thumb-->
							</div><!--end span6-->
						</div><!--end product-details-->

					</div><!--end row-->
					

				</div><!--end span6-->


				<div class="span6">
				
					<div class="product-title">
						<h3><?php echo $product->name;?></h3>
					</div>
					
					
					<div class="product-set">
						<div class="row">
							<div class="span8">
								<?php echo $product->excerpt;?>
							</div>
						</div>
						<div class="product-info">
							<dl class="dl-horizontal">
							  <dt>Diponiblité:</dt>
							  <dd>En Stock</dd>
	
							  <dt>Produit Ref:</dt>
							  <dd>No. <?php echo $product->id;?></dd>
	
							</dl>
						</div>
						<div class="product-price">
							<span>
								<span class="strike-through"><?php echo (int)$product->price?format_currency($product->price):''; ?></span>
								<?php echo format_currency($product->saleprice); ?>
							</span>
						</div>
						<div class="product-inputs">
							<?php echo form_open('cart/add_to_cart', 'class="form-horizontal"');?>
							<input type="hidden" name="cartkey" value="<?php echo $this->session->flashdata('cartkey');?>" />
							<input type="hidden" name="id" value="<?php echo $product->id?>"/>
							<div class="input-append">
								<select class="span1" name="quantity" id="quantity">
					                <option value="1">1</option>
					                <option value="2">2</option>
					                <option value="3">3</option>
					                <option value="4">4</option>
					                <option value="5">5</option>
					                <option value="6">6</option>
					                <option value="7">7</option>
					                <option value="8">8</option>
					                <option value="9">9</option>
					                <option value="10">10</option>
					                <option value="">Saissir</option>
					            </select>
								<button class="btn btn-primary"><i class="icon-shopping-cart"></i> <?php echo lang('form_add_to_cart');?></button>
							</div>
							<script type="text/javascript">
							$( "#quantity" ).change(function() {
									if($(this).val()=='') {
										$(this).parent().prepend('<input type="text" placeholder="<?php echo lang('quantity') ?>" value="" name="quantity" class="span1"/>');
										$(this).remove();
									}
								});
							</script>
								
							<?php echo form_close()?>
						</div>
					
					</div>
					
					<div class="product-tab">
						<ul class="nav nav-tabs">
						  <li class="active">
						  	<a href="#descraption" data-toggle="tab">Description</a>
						  </li>
						  <li>
						  	<a href="#specfications" data-toggle="tab">Prix Promotion</a>
						  </li>
						  <li>
						  	<a href="#return-info" data-toggle="tab">Retour Info</a>
						  </li>
						</ul>
						<div class="tab-content">
							<div class="tab-pane active" id="descraption">
								<p>
									<?php echo $product->description; ?>
								</p>
							</div>
							<div class="tab-pane" id="specfications">
							<?php if(isset($product->option) and !empty($product->option)){?>
								<table class="table table-compare">
									<?php foreach ($product->option as $optionPrice){?>
									<tr>
										<td class="aligned-color"><h5>A partir de </h5></td>
										<td><?php echo $optionPrice->unit?> unités </td>
										<td><?php echo $optionPrice->price?> € l'unité</td>
									</tr>
									<?php }?>
								</table>
								<?php }else{
									echo "<div class='alert'><strong>Désolé!</strong> Il n'y pas de promotion sur ce produit pour l'instant. </div>";
								}?>
							</div>
							<div class="tab-pane" id="return-info">
								<h4>Read our Returning info</h4><br>
								<p>
								Merci de nous contacter le service clients : 6 jours sur 7 (du lundi au samedi inclus)<br/>
								 au Numéro de tél : 01 45 47 64 24 ou<br/> par mail à contact@asieco.com (réponse dans 24 heures) 
								</p>
							</div>

							
						</div><!--end tab-content-->
					</div><!--end product-tab-->
				</div><!--end span6-->


	<?php if(!empty($product->related_products)):?>


					<div class="related-product">
						<div class="titleHeader clearfix">
							<h3>Related Product</h3>
						</div><!--end titleHeader-->

						<div class="row">
						<ul class="hProductItems clearfix">
						
						
						<?php foreach($product->related_products as $relate):?>
							<li class="span3 clearfix">
								<?php
									$photo	= theme_img('no_picture.png', lang('no_image_available'));
									if(!empty($relate->primary_photo))
										$photo	= '<img src="'.base_url('images/thumbnails/'.$relate->primary_photo).'" alt="'.$relate->seo_title.'"/>';
								?>
						
								<div class="thumbnail">
									<a href="#"><?php echo $photo; ?></a>
								</div>
								
								<div class="thumbSetting">
									<div class="thumbTitle">
										<a href="<?php echo site_url($relate->slug); ?>" class="invarseColor">
											<?php echo $relate->name;?>
										</a>
									</div>
									<div class="thumbPrice">
										<span><?php echo format_currency($relate->price); ?></span>
									</div>

									<div class="thumbButtons">
										<button class="btn btn-primary btn-small" data-title="+To Cart" data-placement="top" rel="tooltip">
											<i class="icon-shopping-cart"></i>
										</button>
									</div>
								</div>
							</li>
				<?php endforeach;?>
						</ul>
						</div><!--end row-->
					</div><!--end related-product-->

	<?php endif;?>


</div>
<?php include('footer.php'); ?>